package com.tqjc.system.common.entity.BO;

import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 86195
 * @version 1.0
 * @description PLC写值请求param对象
 * @date 2023/11/10 16:55
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ToString
public class PLCWriteRequestParamBO {


    private static final long serialVersionUID = 7516450772634970274L;


    /**
     * 所属设备名称
     */
    private String macSN;

    /**
     * 点位地址
     */
    private String address;

    /**
     * 数据类型
     */
    private int dataType;

    /**
     * 写值value
     */
    private String value;

    private String label;

    public String getParamJSONString(){
        Map map = new HashMap(4);
        map.put("mac_sn",this.macSN);
        map.put("address",this.address);
        map.put("dataType",this.dataType);
        map.put("values",this.value);
        return JSON.toJSONString(map);
    }
}
